2020-2021 Sunseeker Telemetry and Lighting System
eusci_b_i2c_ex2_masterRxSingle.c File Reference
#include "driverlib.h"

Go to the source code of this file.

Macros

#define SLAVE_ADDRESS   0x48
 

Functions

void main (void)
 

Variables

uint8_t RXData
 

Macro Definition Documentation

◆ SLAVE_ADDRESS

#define SLAVE_ADDRESS   0x48

This example shows how to configure the I2C module as a master for single byte reception in interrupt driven mode. The address of the slave module that the master is communicating with also set in this example.

Description: This demo connects two MSP430's via the I2C bus. The master reads from the slave. This is the MASTER CODE. The data from the slave transmitter begins at 0 and increments with each transfer. The USCI_B0 RX interrupt is used to know when new data has been received. ACLK = n/a, MCLK = SMCLK = BRCLK = DCO = 1MHz

                          /|\  /|\
         MSP430F67791A     10k  10k     MSP430F67791A
             slave         |    |        master
       -----------------   |    |   -----------------
     -|XIN  P2.6/UCB0SDA|<-|----+->|P2.6/UCB0SDA  XIN|-
      |                 |  |       |                 | 32kHz
     -|XOUT             |  |       |             XOUT|-
      |     P2.5/UCB0SCL|<-+------>|P2.5/UCB0SCL     |
      |                 |          |             P1.0|--> LED

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • I2C peripheral
  • GPIO Port peripheral (for I2C pins)
  • SCL2
  • SDA

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • USCI_B0_VECTOR.

Definition at line 82 of file eusci_b_i2c_ex2_masterRxSingle.c.

Function Documentation

◆ main()

void main ( void  )

Definition at line 85 of file eusci_b_i2c_ex2_masterRxSingle.c.

References __delay_cycles(), param, RXData, and SLAVE_ADDRESS.

Variable Documentation

◆ RXData

uint8_t RXData

Definition at line 84 of file eusci_b_i2c_ex2_masterRxSingle.c.

Referenced by main().